home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / pine / osdep / os-win.h < prev    next >
C/C++ Source or Header  |  1996-06-05  |  17KB  |  509 lines

  1. #line 2 "osdep/os-win.h"
  2. /*----------------------------------------------------------------------
  3.   $Id: os-win.h,v 4.41 1996/06/05 17:12:38 mikes Exp $
  4.  
  5.             T H E    P I N E    M A I L   S Y S T E M
  6.  
  7.    Laurence Lundblade and Mike Seibel
  8.    Networks and Distributed Computing
  9.    Computing and Communications
  10.    University of Washington
  11.    Administration Builiding, AG-44
  12.    Seattle, Washington, 98195, USA
  13.    Internet: lgl@CAC.Washington.EDU
  14.              mikes@CAC.Washington.EDU
  15.  
  16.    Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  17.  
  18.  
  19.    Pine and Pico are registered trademarks of the University of Washington.
  20.    No commercial use of these trademarks may be made without prior written
  21.    permission of the University of Washington.
  22.  
  23.    Pine, Pico, and Pilot software and its included text are Copyright
  24.    1989-1996 by the University of Washington.
  25.  
  26.    The full text of our legal notices is contained in the file called
  27.    CPYRIGHT, included with this distribution.
  28.  
  29.  
  30.    Pine is in part based on The Elm Mail System:
  31.     ***********************************************************************
  32.     *  The Elm Mail System  -  Revision: 2.13                             *
  33.     *                                                                     *
  34.     *             Copyright (c) 1986, 1987 Dave Taylor              *
  35.     *             Copyright (c) 1988, 1989 USENET Community Trust   *
  36.     ***********************************************************************
  37.  
  38.  
  39.   ----------------------------------------------------------------------*/
  40.  
  41. #ifndef _OS_INCLUDED
  42. #define _OS_INCLUDED
  43.  
  44.  
  45. /*----------------------------------------------------------------------
  46.  
  47.    This first section has some constants that you may want to change
  48.    for your configuration.  This is the DOS version of the os.h file.
  49.    Further down in the file are os-dependent things that need to be set up
  50.    correctly for each os.  They aren't interesting, they just have to be
  51.    right.  There are also a few constants down there that may be of
  52.    interest to some.
  53.  
  54.  ----*/
  55.  
  56. /*----------------------------------------------------------------------
  57.  Define this if you want the disk quota to be checked on startup.
  58.  Of course, this only makes sense if your system has quotas.  If it doesn't,
  59.  there should be a dummy disk_quota() routine in os-xxx.c so that defining
  60.  this won't be harmful anyway.
  61.  ----*/
  62. /* #define USE_QUOTAS */
  63.  
  64.  
  65.  
  66. /*----------------------------------------------------------------------
  67.    Define this if you want to allow the users to change their From header
  68.    line when they send out mail.  The users will still have to configure
  69.    either default-composer-hdrs or customized-hdrs to get at the From
  70.    header, even if this is set.
  71.  ----*/
  72. /* #define ALLOW_CHANGING_FROM  /* comment out to not allow changing From */
  73.  
  74.  
  75.  
  76. /*----------------------------------------------------------------------
  77.     Turn this on if you want to disable the keyboard lock function.
  78.  ----*/
  79. /* #define NO_KEYBOARD_LOCK */
  80.  
  81.  
  82.  
  83. /*----------------------------------------------------------------------
  84.     Turn this on to trigger QP encoding of sent message text if it contains
  85.   "From " at the beginning of a line or "." on a line by itself.
  86.  ----*/
  87. /* #define ENCODE_FROMS */
  88.  
  89.  
  90.  
  91. /*----------------------------------------------------------------------
  92.     Turn this on if you want to disable PC-Pine's including of 
  93.   "X-Warning" and "X-Sender" header lines in outgoing messages.
  94.  ----*/
  95. /* #define NOAUTH */
  96.  
  97.  
  98.  
  99. /*----------------------------------------------------------------------
  100.     Timeouts (seconds)
  101.  ----*/
  102. #define DF_MAILCHECK      "150" /* How often to check for new mail, by
  103.                    default.  There's some expense in doing
  104.                    this so it shouldn't be done too
  105.                    frequently.  (Can be set in config
  106.                    file now.)  */
  107.  
  108. /*----------------------------------------------------------------------
  109.     Check pointing (seconds)
  110.  ----*/
  111. #define CHECK_POINT_TIME (7*60) /* Check point the mail file (write changes
  112.                    to disk) if more than CHECK_POINT_TIME
  113.                    seconds have passed since the first
  114.                    change was made.  Depending on what is
  115.                    happening, we may wait up to three times
  116.                    this long, since we don't want to do the
  117.                    slow check pointing and irritate the user. */
  118.                                      
  119. #define CHECK_POINT_FREQ   (12) /* Check point the mail file if there have been
  120.                                    at least this many (status) changes to the
  121.                    current mail file.  We may wait longer if
  122.                    it isn't a good time to do the checkpoint. */
  123.  
  124.  
  125.  
  126. /*----------------------------------------------------------------------
  127.  In scrolling through text, the number of lines from the previous
  128.  screen to overlap when showing the next screen.  Usually set to two.
  129.  ----*/
  130. #define    DF_OVERLAP    "2"
  131.  
  132.  
  133.  
  134. /*----------------------------------------------------------------------
  135.  When scrolling screens, the number of lines from top and bottom of
  136.  the screen to initiate single-line scrolling.
  137.  ----*/
  138. #define    DF_MARGIN    "0"
  139.  
  140.  
  141.  
  142. /*----------------------------------------------------------------------
  143.  Default fill column for pine composer and maximum fill column.  The max
  144.  is used to stop people from setting their custom fill column higher than
  145.  that number.  Note that DF_FILLCOL is a string but MAX_FILLCOL is an integer.
  146.  ----*/
  147. #define    DF_FILLCOL    "74"
  148. #define    MAX_FILLCOL    80
  149.  
  150.  
  151.  
  152. /*----- System-wide config file ----------------------------------------*/
  153. #define SYSTEM_PINERC "pinerc"
  154.  
  155.  
  156.  
  157. /*----- Used only in DOS -----------------------------------------------*/
  158. #define DF_PINEDIR      "\\pine"
  159. #define HELPFILE        "pine.hlp"
  160. #define HELPINDEX       "pine.ndx"
  161.   
  162.   
  163.   
  164. /*----------------------------------------------------------------------
  165.    The default folder names and folder directories (some for backwards
  166.    compatibility).  Think hard before changing any of these.
  167.  ----*/
  168. #define DF_DEFAULT_FCC            "sentmail"
  169. #define DEFAULT_SAVE              "savemail"
  170. #define POSTPONED_MAIL            "postpone"
  171. #define POSTPONED_MSGS            "postpond"
  172. #define INTERRUPTED_MAIL          "intruptd"
  173. #define DEADLETTER                "deadletr"
  174. #define    DF_FOLDER_EXTENSION      "MTX"
  175. #define DF_MAIL_DIRECTORY         "mail"
  176. #define INBOX_NAME                "INBOX"
  177. #define DF_SIGNATURE_FILE         "pine.sig"
  178. #define DF_ELM_STYLE_SAVE         "no"
  179. #define DF_HEADER_IN_REPLY        "no"
  180. #define DF_OLD_STYLE_REPLY        "no"
  181. #define DF_USE_ONLY_DOMAIN_NAME   "no"
  182. #define DF_FEATURE_LEVEL          "sapling"
  183. #define DF_SAVE_BY_SENDER         "no"
  184. #define DF_SORT_KEY               "arrival"
  185. #define DF_AB_SORT_RULE           "fullname-with-lists-last"
  186. #define DF_SAVED_MSG_NAME_RULE    "default-folder"
  187. #define DF_FCC_RULE               "default-fcc"
  188. #define DF_STANDARD_PRINTER       "lpr"
  189. #define ANSI_PRINTER              "attached-to-ansi"
  190. #define DF_ADDRESSBOOK            "addrbook"
  191. #define DF_BUGS_FULLNAME          "Pine Developers"
  192. #define DF_BUGS_ADDRESS           "pine-bugs@cac.washington.edu"
  193. #define DF_SUGGEST_FULLNAME       "Pine Developers"
  194. #define DF_SUGGEST_ADDRESS        "pine-suggestions@cac.washington.edu"
  195. #define DF_PINEINFO_FULLNAME      "Pine-Info News Group"
  196. #define DF_PINEINFO_ADDRESS       "pine-info@cac.washington.edu"
  197. #define DF_LOCAL_FULLNAME         "Local Support"
  198. #define DF_LOCAL_ADDRESS          "postmaster"
  199. #define DF_KBLOCK_PASSWD_COUNT    "1"
  200.  
  201. /*----------------------------------------------------------------------
  202.    The default printer when pine starts up for the first time with no printer
  203.  ----*/
  204. #define DF_DEFAULT_PRINTER        ANSI_PRINTER
  205.  
  206.  
  207.  
  208. /*----------------------------------------------------------------------
  209.  
  210.    OS dependencies, DOS version.  See also the os-dos.c files.
  211.    The following stuff may need to be changed for a new port, but once
  212.    the port is done it won't change.  Further down in the file are a few
  213.    constants that you may want to configure differently than they
  214.    are configured, but probably not.
  215.  
  216.  ----*/
  217.  
  218.  
  219.  
  220. /*----------------- Are we ANSI? ---------------------------------------*/
  221. #define ANSI
  222.  
  223. /*------ If our compiler doesn't understand type void ------------------*/
  224. /* #define void char */
  225.  
  226. /*-------- Standard ANSI functions usually defined in stdlib.h ---------*/
  227. #include <stdlib.h>
  228. /*---- Declare getenv() if not already declared ------------------------*/
  229. /* char *getenv(); */
  230.  
  231.  
  232. /*------- Standard string functions ------------------------------------*/
  233. #include <string.h>
  234. /*---- Declare these if not already declared ---------------------------*/
  235. /* char *strcpy(), *strncpy(); */
  236.  
  237.  
  238. /*------- Include types.h if you have it -------------------------------*/
  239. #include <sys/types.h>
  240.  
  241.  
  242. /*-------- Standard windows defines and then our window module defines. */
  243. #include <windows.h>
  244. #include "../pico/mswin.h"
  245.  
  246.  
  247. /*------- Some systems need this ---------------------------------------*/
  248. /* #include <stdarg.h> */
  249.  
  250.  
  251. #include <io.h>
  252. #include <sys/stat.h>
  253. #ifdef    PCTCP
  254. #include <4bsddefs.h>            /* PC/TCP Include Files */
  255. #include <netdb.h>
  256. #undef    signal                /* override their stupid def */
  257. #define    sleep    _sleep            /* use pico's sleep function */
  258. #else
  259. #ifdef    LWP
  260. #include <sys/socket.h>            /* LanWorkplace Include Files */
  261. #include <netinet/in.h>
  262. #include <netdb.h>
  263. #else
  264. #ifdef    PCNFS
  265. #include <tklib.h>
  266. #include <netdb.h>
  267. #else
  268. #ifdef  WATTCP
  269. #include <tcp.h>            /* WATTCP Include File */
  270. #else
  271. #include <winsock.h>            /* Otherwise, must be windows. */
  272. #endif
  273. #endif
  274. #endif
  275. #endif
  276. #include <dos.h>
  277. #include <direct.h>
  278. #include <memory.h>
  279. #include <fcntl.h>
  280. #include <sys/timeb.h>
  281.  
  282. #undef ERROR
  283.  
  284.  
  285. /*---- Declare sys_errlist() if not already declared -------------------*/
  286. /* extern char *sys_errlist[]; */
  287.  
  288.  
  289.  
  290. /*----------------- locale.h -------------------------------------------*/
  291. /* #include <locale.h>  /* To make matching and sorting work right */
  292.  
  293.  
  294.  
  295. /*----------------- time.h ---------------------------------------------*/
  296. #include <time.h>
  297. /* plain time.h isn't enough on some systems */
  298. /* #include <sys/time.h>  /* For struct timeval usually in time.h */ 
  299.  
  300.  
  301.  
  302. /*--------------- signal.h ---------------------------------------------*/
  303. #include <signal.h>
  304. /* #include <sys/signal.h> */
  305.  
  306. #define SigType void     /* value returned by sig handlers is void */
  307. /* #define SigType int      /* value returned by sig handlers is int */
  308.  
  309. /* #define POSIX_SIGNALS */
  310. /* #define SYSV_SIGNALS    /* use System-V signal semantics (ttyin.c) */
  311.  
  312.  
  313.  
  314.  
  315. /*-------------- A couple typedef's for integer sizes ------------------*/
  316. typedef unsigned long usign32_t;
  317. typedef unsigned short usign16_t;
  318.  
  319.  
  320.  
  321. /*-------------- qsort argument type -----------------------------------*/
  322. #define QSType void
  323. /* #define QSType char */
  324.  
  325.  
  326.  
  327. /*------ how help text is referenced (always char ** on Unix) ----------*/
  328. #define HelpType short
  329. #define NO_HELP (-1)
  330.  
  331.  
  332.  
  333. /*--------- System V terminal driver -----------------------------------*/
  334. /* #define HAVE_TERMIO   this is for pure System V */
  335. /* #define HAVE_TERMIOS  this is an alternative    */
  336. /*- Use the poll() system call instead of select() */
  337. /* #define USE_POLL */
  338. /*---- Use terminfo instead of termcap ---------------------------------*/
  339. /* #define USE_TERMINFO */
  340. /* #include <sys/stream.h>    /* for ptem.h */
  341. /* #include <sys/ptem.h>    /* for struct winsize */
  342.  
  343.  
  344.  
  345. /*-------- Is window resizing available? -------------------------------*/
  346. /* #define RESIZING */
  347.     /* Actually, under windows it is, but RESIZING compiles in UNIX 
  348.      * signals code for determining when the window resized.  Window's
  349.      * works differently. */
  350.  
  351.  
  352.  
  353.  
  354. /*-------- If no vfork, use regular fork -------------------------------*/
  355. /* #define vfork fork */
  356.  
  357.  
  358.  
  359. /*----------------------------------------------------------------------
  360.     This is DOS specific and is used to determine if a mail message is
  361.  too big to fit in core.  It's just a static value now, but could be
  362.  turned into a fuller macro that takes an adaptive approach to figure
  363.  out what can fit into available free storage.
  364.  Examining mailboxes around here, it looks like 90-something percent of
  365.  messages come in under 8K so that seems like an OK limit on what can
  366.  be dealt with in core.
  367.  ----*/
  368. #define MAX_MSG_INCORE  (8192L)
  369.  
  370.  
  371.  
  372. /*----------------------------------------------------------------------
  373.     This is DOS specific and is used to pass the results of dos_gets
  374.  calls back to functions that had previously installed it as the
  375.  c-client "mailgets" allocation function.  It's basically a way around
  376.  c-client's exclusive use of malloc'd strings which is quite
  377.  impractical if we want to deal with text objects bigger than 64K on
  378.  DOS (assuming we even have 64 contiguous K anyway!).
  379.  ----*/
  380. extern  FILE    *append_file;
  381.  
  382.  
  383.  
  384. /*----------------------------------------------------------------------
  385.     This is DOS specific and is used to fake the results of SIGALRM
  386.  signal handling without an alarm system call.
  387.  ----*/
  388. /* #define  ALARM_BLIP()  fake_alarm_blip() */
  389. extern unsigned alarm(unsigned);
  390.  
  391.  
  392.  
  393. /*----- The usual sendmail configuration for sending mail on Unix ------*/
  394. /* #define SENDMAIL    "/usr/lib/sendmail" */
  395. /* #define SENDMAILFLAGS    "-bs -odb -oem"    /* send via smtp with backgroud
  396.                        delivery and mail back errors */
  397.  
  398.  
  399. /*----------------------------------------------------------------------
  400.    If no nntp-servers are defined, this program will be used to post news.
  401.  ----*/
  402. /* #define SENDNEWS    "/usr/local/bin/inews -h"    /* news posting cmd */
  403.  
  404.  
  405. /*--------- Program employed by users to change their password ---------*/
  406. /* #define PASSWD_PROG     "" */
  407.  
  408.  
  409. /*-------------- A couple constants used to size arrays ----------------*/
  410. /* #include <sys/param.h>          /* Get it from param.h if available */
  411. /* #define MAXPATH MAXPATHLEN      /* Longest pathname we ever expect */
  412. #define MAXPATH        (256)    /* Longest pathname we ever expect */
  413. #define MAXFOLDER      (64)     /* Longest foldername we ever expect */  
  414.  
  415.  
  416. /*-- Max screen pine will display on. Used to define some array sizes --*/
  417. #define MAX_SCREEN_COLS  (250) 
  418. #define MAX_SCREEN_ROWS  (150) 
  419.  
  420.  
  421. /*---- When no screen size can be discovered this is the size used -----*/
  422. #define DEFAULT_LINES_ON_TERMINAL    (25)
  423. #define DEFAULT_COLUMNS_ON_TERMINAL    (80)
  424.  
  425.  
  426. /*----------------------------------------------------------------------
  427.     Where to put the output of pine in debug mode. Files are created
  428.  in the user's home directory and have a number appended to them when
  429.  there is more than one.
  430.  ----*/
  431. #define DEBUGFILE    "pinedebg.txt"
  432. #define CRASHFILE    "pinecrsh.txt"
  433.  
  434. /*----------------------------------------------------------------------
  435.     The number of debug files to save in the user's home diretory. The files
  436.  are useful for figuring out what a user did when he complains that something
  437.  went wrong. It's important to keep a bunch around, usually 4, so that the
  438.  debug file in question will still be around when the problem gets 
  439.  investigated. Users tend to go in and out of Pine a few times and there
  440.  is one file for each pine invocation
  441.  ----*/
  442. #define NUMDEBUGFILES 4
  443.  
  444. /*----------------------------------------------------------------------
  445.    The default debug level to set (approximate meanings):
  446.        1 logs only highest level events and errors
  447.        2 logs events like file writes
  448.        3
  449.        4 logs each command
  450.        5
  451.        6 
  452.        7 logs details of command execution (7 is highest to run any production)
  453.        8
  454.        9 logs gross details of command execution
  455.  ----*/
  456. #define DEFAULT_DEBUG 2
  457.  
  458.  
  459.  
  460. /*----------------------------------------------------------------------
  461.     Various maximum field lengths, probably shouldn't be changed.
  462.  ----*/
  463. #define MAX_FULLNAME     (100) 
  464. #define MAX_NICKNAME      (40)
  465. #define MAX_ADDRESS      (200)
  466. #define MAX_NEW_LIST     (500)  /* Max addrs to be added when creating list */
  467. #define MAX_SEARCH       (100)  /* Longest string to search for             */
  468. #define MAX_ADDR_EXPN   (1000)  /* Longest expanded addr                    */
  469. #define MAX_ADDR_FIELD (10000)  /* Longest fully-expanded addr field        */
  470.  
  471.  
  472. #define ibmgetc        mswin_getc
  473. #define ibmopen        mswin_open
  474. #define ibmclose    mswin_close
  475. #define ibmmove        mswin_move
  476. #define ibmputs        mswin_puts
  477. #define ibmputc        mswin_putc
  478. #define ibmoutc        mswin_outc
  479. #define ibmrev        mswin_rev
  480. #define ibmeeol        mswin_eeol
  481. #define ibmeeop        mswin_eeop
  482. #define ibmbeep        mswin_beep
  483. #define ibmflush    mswin_flush
  484.  
  485.  
  486. /*
  487.  * The following function names conflict with lower case function names
  488.  * in pine.  Rename them here to avoid the conflict.
  489.  */
  490. #define MoveCursor    PineMoveCursor
  491. #define NewLine        PineNewLine
  492.  
  493. /*
  494.  * redefine our entry point
  495.  */
  496. #define    main    app_main
  497.  
  498. /*
  499.  * Define the function called to build the windows command menu.
  500.  */
  501. void    build_cmd_menu ();
  502.  
  503. #include    "../pico/msmenu.h"
  504.  
  505. #include    "osdep/resource.h"
  506. #include    "osdep/windlg.h"
  507.  
  508. #endif /* _OS_INCLUDED */
  509.